/**
 * @Description: 获取key指定的缓存
 * @Author: ZhangHan
 * @Date: 2025-08-18 17:38:57
 */
export function getLocalStorage(key: string) {
  try {
    return uni.getStorageSync(key);
  } catch (e) {
    return "";
  }
}

/**
 * @Description: 设置缓存
 * @Author: ZhangHan
 * @Date: 2025-08-18 17:39:18
 */
export function setLocalStorage(key: string, data: any) {
  uni.setStorageSync(key, data);
}

/**
 * @Description: 清空全部缓存
 * @Author: ZhangHan
 * @Date: 2025-08-18 17:39:34
 */
export function clearLocalStorage() {
  uni.clearStorageSync();
}

/**
 * @Description: 从本地缓存中同步移除指定 key
 * @Author: ZhangHan
 * @Date: 2025-08-18 17:39:57
 */
export function removeStorage(key: string) {
  uni.removeStorageSync(key);
}
